package api

type ChaosStatus string

const (
	Injected     ChaosStatus = "injected"
	Injecting    ChaosStatus = "injecting"
	InjectFailed ChaosStatus = "injectFailed"
	Running      ChaosStatus = "running"
)

type Chaos struct {
	Desc      string `json:"describe"`
	ChaosType string `json:"chaos_type"`
	/*	ComplexAction is splice by chaos_type#chaos_action#options
		Example:
			- networkchaos#delay#dns:
				-> chaos_type: networkchaos
				-> chaos_action: delay
				-> option: dns means only dns request will be influenced
			- jvmchaos#ruleData#cpucost
		Options can be null
		Example:
			- networkchaos#loss
	*/
	ComplexAction string `json:"complex_action"`

	Instance []string      `json:"instance"`
	Params   []ChaosParams `json:"params"`
	Status   ChaosStatus   `json:"status"`

	Note         string `json:"note"`
	ActionNumber int    `json:"-"`
}

type ChaosParams struct {
	Name    string   `json:"name"`
	Type    string   `json:"type"`
	Value   string   `json:"value"`
	Options []string `json:"options"`
}
